/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package uvexposureapplication.sensors;

import java.util.HashMap;
import java.util.Map;
import uvexposureapplication.utils.IOStream;

/**
 *
 * @author matthieukluj
 */
public class TemperatureSensor extends AbstractSensor implements Runnable{
    
    public TemperatureSensor(String name, String server) {
        super(name, server);
        this.initData = IOStream.readSensorsData("./data/sensorsData/" + name+"Temperature");
    }
    
    @Override
    public void report(String value, String timeElapsed) {
        //System.out.println("temp = " + value);
        System.out.println("[SENDING] Current Temperature TO ContextManager");
        Map<String, String> notification = new HashMap<String, String>();
        notification.put("Group", "Sensor");
        notification.put("Type", "Temperature");
        notification.put("UserName", this.name);
        notification.put("Value", value);
        notification.put("Time", timeElapsed);
        this.producer.produceFromCollection(notification);
    }
}
